<?xml version="1.0" encoding="UTF-8"?>
<%@ page language="java" contentType="text/xml; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="oracle.jdbc.driver.OracleDriver"%>
<%@ page import="java.sql.*"%>
<%@page import="com.bean.DBConnection"%>


<jsp:useBean id="sel" class="DBConnection"></jsp:useBean>
<%  
	
int index = Integer.parseInt(request.getParameter("start"));
int pageSize= Integer.parseInt(request.getParameter("limit"));
String keyword=request.getParameter("keyword");
 int f=index+1;
 int temp=index+pageSize;
 int t=1;
 int k=Integer.parseInt(keyword);
 ResultSet rs = null;
Connection conn=sel.getConn();

//Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
//String url="jdbc:oracle:thin:@localhost:1521:orcl";
//String user="system";
//String password="oracle";

 

String sql;
//Connection conn=DriverManager.getConnection(url,user,password);
Statement stat=conn.createStatement();
sql="select * from demo_log";
 rs=stat.executeQuery(sql);
while (rs.next()) {
 				t++;
 			}

//if("".equals(keyword)||keyword==null){
      sql="select * from (select a.*,rownum rn from(select * from demo_log) a) where rn between "+f+"and "+temp ;
//}else{
     // sql="select * from (select a.*,rownum rn from(select * from demo_log) a) where rn between"+ f +"and "+ temp;
//}

 rs=stat.executeQuery(sql);

out.println("<log>");
out.println("<totalProperty>");//分页在本版本加
out.println(t);
out.println("</totalProperty>");

while(rs.next()){
out.println("<record>");
out.println("<log_id>");
out.println(rs.getString(1));
out.println("</log_id>");
out.println("<fac_id>");
out.println(rs.getString(2));
out.println("</fac_id>");
out.println("<oprt>");
out.println(rs.getString(3));
out.println("</oprt>");
out.println("<user_id>");
out.println(rs.getString(4));
out.println("</user_id>");
out.println("<oprt_date>");
out.println(rs.getString(5));
out.println("</oprt_date>");
out.println("</record>");
}
out.println("</log>");
%>


 










